package com.ktjy.listener;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.ExecutionListener;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.stereotype.Component;

@Component
public class TaskListenerImpl implements TaskListener {

    @Override
    public void notify(DelegateTask delegateTask) {
        if (delegateTask.getName().equals("销售主管审核")) {
            delegateTask.setAssignee("李四");
        } else if (delegateTask.getName().equals("销售经理审核")) {
            delegateTask.setAssignee("李峰");
        } else if (delegateTask.getName().equals("总经理审核")) {
            delegateTask.setAssignee("谢逊");
        }
    }
}
